




//
//  MainDetailTViewCell.m
//  1243
//
//  Created by apple on 16/7/6.
//  Copyright © 2016年 1243. All rights reserved.
//

#import "MainDetailTViewCell.h"

@implementation MainDetailTViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.backgroundColor = [UIColor colorWithRed:228/255.0 green:229/255.0 blue:234/255.0 alpha:1];
        UIView *backView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, WIDTH/3 + 120)];
        backView.backgroundColor = [UIColor whiteColor];
        
        self.titleLB = [[UILabel alloc]initWithFrame:CGRectMake(10, 0, 100, 40)];
//        self.titleLB.text = @"一元夺宝";
        
        self.aititudeLB = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH - 100, 0, 100, 40)];
        self.aititudeLB.textColor = [UIColor orangeColor];
        
        UILabel *oneLine = [[UILabel alloc]initWithFrame:CGRectMake(0, 40, WIDTH, 1)];
        oneLine.backgroundColor = [UIColor lightGrayColor];
        
        self.picImg = [[UIImageView alloc]initWithFrame:CGRectMake(10, 50, WIDTH/3, WIDTH/3)];
        self.picImg.backgroundColor = [UIColor yellowColor];
        
        self.nameLB = [[SizeFiteLabel alloc]initWithFrame:CGRectMake(WIDTH/3 + 20, 70, WIDTH - (WIDTH/3 + 30), 10)];
        self.nameLB.mHV = NO;
        self.nameLB.backgroundColor = [UIColor cyanColor];
        
        self.qiLB = [[UILabel alloc]initWithFrame:CGRectMake(WIDTH/3 + 20, 150, 70, 20)];
        self.qiLB.font = [UIFont systemFontOfSize:12];
        
        UILabel *twoline = [[UILabel alloc]initWithFrame:CGRectMake(0, 50+WIDTH/3+10, WIDTH, 0.5)];
        twoline.backgroundColor = [UIColor lightGrayColor];
        
        self.moneyLB = [[UILabel alloc]initWithFrame:CGRectMake(10, 50+WIDTH/3+25, WIDTH/3, 30)];
        self.moneyLB.textColor = [UIColor orangeColor];
        self.moneyLB.font = [UIFont systemFontOfSize:14];
        
        
        
        self.doItAgainBT = [UIButton buttonWithType:UIButtonTypeCustom];
        self.doItAgainBT.frame = CGRectMake(WIDTH -100, 50+WIDTH/3+22, 85, 35);
        self.doItAgainBT.layer.masksToBounds = YES;
        self.doItAgainBT.layer.cornerRadius = 5;
        [self.doItAgainBT setTitle:@"继续抢宝" forState:UIControlStateNormal];
        self.doItAgainBT.backgroundColor = [UIColor colorWithRed:45/255.0 green:85/255.0 blue:229/255.0 alpha:1];
        [self.doItAgainBT addTarget:self action:@selector(jumpToMain:) forControlEvents:UIControlEventTouchUpInside];
        
        [self.contentView addSubview:backView];
        [backView addSubview:self.titleLB];
        [backView addSubview:oneLine];
        [backView addSubview:self.aititudeLB];
        [backView addSubview:self.picImg];
        [backView addSubview:self.nameLB];
        [backView addSubview:self.qiLB];
        [backView addSubview:twoline];
        [backView addSubview:self.moneyLB];
        [backView addSubview:self.doItAgainBT];
    }
    return self;
}

- (void)jumpToMain:(UIButton *)sender {
    NSLog(@"点击");
    if (self.jumpToMainBlock) {
        self.jumpToMainBlock();
    }
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
